package com.zkn.orm.spring.data.jpa.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Department
 * 
 * @author Frank.Su
 *
 */
@SuppressWarnings("serial")
@Entity
@Table(name="Department")
public class Department implements Serializable {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer departmentId;
	// VARCHAR(200) NOT NULL
	private String departmentName;
	// VARCHAR(50) NOT NULL
	private String departmentCode;
	// VARCHAR(500)
	private String decription;
	// DATETIME
	@Temporal(TemporalType.TIMESTAMP)
	private Date isObsoleteDate;
	// VARCHAR(50)
	private String createBy;
	@Temporal(TemporalType.TIMESTAMP)
	private Date createOn;
	private String modifiedBy;
	@Temporal(TemporalType.TIMESTAMP)
	private Date modifiedOn;
	@ManyToOne(cascade={CascadeType.REMOVE, CascadeType.REFRESH})
	@JoinColumn(name="parentId")
	private Department parent;

	public Integer getDepartmentId() {
		return departmentId;
	}
	public void setDepartmentId(Integer departmentId) {
		this.departmentId = departmentId;
	}
	public String getDepartmentName() {
		return departmentName;
	}
	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}
	public String getDepartmentCode() {
		return departmentCode;
	}
	public void setDepartmentCode(String departmentCode) {
		this.departmentCode = departmentCode;
	}
	public String getDecription() {
		return decription;
	}
	public void setDecription(String decription) {
		this.decription = decription;
	}
	public Date getIsObsoleteDate() {
		return isObsoleteDate;
	}
	public void setIsObsoleteDate(Date isObsoleteDate) {
		this.isObsoleteDate = isObsoleteDate;
	}
	public String getCreateBy() {
		return createBy;
	}
	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}
	public Date getCreateOn() {
		return createOn;
	}
	public void setCreateOn(Date createOn) {
		this.createOn = createOn;
	}
	public String getModifiedBy() {
		return modifiedBy;
	}
	public void setModifiedBy(String modifiedBy) {
		this.modifiedBy = modifiedBy;
	}
	public Date getModifiedOn() {
		return modifiedOn;
	}
	public void setModifiedOn(Date modifiedOn) {
		this.modifiedOn = modifiedOn;
	}
	public Department getParent() {
		return parent;
	}
	public void setParent(Department parent) {
		this.parent = parent;
	}
}
